<%--

<!--------------------------------------------------------------------------------------------------------------------------------
 - Copyright 2007 CORE Solutions Limited
 - All rights reserved.
 - PROPRIETARY AND CONFIDENTIAL INFORMATION.
 - Use is subject to license terms.
 -
 - FUNCTION ID      :   ACCESS_TEAM
 - AUTHOR           :   Jerry Chen 
 - DATE CREATE      :   2007/10/26
 - DESCRIPTION      :   a MAINTENANCE CONTENT JSP file for the function, ACCESS_TEAM
 -                  :   
 -                  :   
 -                  :   
 -
 - MODIFICATION HISTORY:
 - DATE         AUTHOR          VERSION NO.         COMMENT
 - -----------  --------------  ------------------  -------------------
 - 2007/10/26   Jerry Chen      1.0                 source is generated.
 -
 -
 -
--------------------------------------------------------------------------------------------------------------------------------->

--%>
<%@ include file="/jsp/com/erp/app/common/jsp/directives_include.jsp"%>

<%@ page import="com.erp.app.setup.accessTeamMaster.vo.AccessTeamHdrVo"%>
<%@ page import="com.erp.app.setup.accessTeamMaster.web.AccessTeamMaintenanceAction"%>
<%@ page import="com.erp.app.util.web.TabInfo"%>

<%@ include file="/jsp/com/erp/app/common/jsp/html_include.jsp"%>

<jsp:useBean id="accessTeamMaintenanceForm" scope="session" type="com.erp.app.setup.accessTeamMaster.web.AccessTeamMaintenanceForm" />

<script language="javascript">

	function doLoad() {
		<%
		if (CommonUtil.nullToString((String)session.getAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE)).equals(ProjectConstants.GENERIC_YES)) {
			session.removeAttribute(ProjectConstants.SESSION_ALERT_AFTER_SAVE);
			out.println("alert('Records saved.');");
		}
		%>

		<%
		String lastAction = CommonUtil.nullToString(accessTeamMaintenanceForm.getPageEvent());

		if (lastAction.startsWith(ProjectConstants.ACTION_SPEDIT)) {
			out.println(WebUtil.openSelectRemarkTextDo());
		}
		%>
	}

</script>

<body onLoad="javascript:doLoad();">
<html:form action="/accessTeamMaintenance">

<html:hidden property="pageEvent"/>
<html:hidden property="pageMode"/>
<html:hidden property="deleteIdx"/>
<html:hidden property="pageEventSrc"/>

<table class="table_button">

<tr>
	<td>
		<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_EXIT%>"
			styleClass="button1"/>
		<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_SEARCH%>"
			styleClass="button1"/>
		<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_CREATE%>"
			styleClass="button1"/>
		<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_SAVE%>"
			styleClass="button1"/>
		<logic:notEqual name="accessTeamMaintenanceForm" property="pageMode" value="<%=accessTeamMaintenanceForm.PAGE_MODE_CREATE%>" >
			<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_REFRESH%>"
				styleClass="button1"/>
			<chtml:button form="accessTeamMaintenanceForm" pageEvent="<%=AccessTeamMaintenanceAction.ACTION_DELETE%>"
				styleClass="button1"/>
		</logic:notEqual>
	</td>
</tr>

</table>

<html:errors />

<div id="tabsF"><ul><%

TableSchema ts = accessTeamMaintenanceForm.getTs();


TabInfo[] tabInfos = new TabInfo[] {
	new TabInfo()
		.setPageEvent(AccessTeamMaintenanceAction.ACTION_CHANGE_FOLDER_HDR)
		.setTitle(ts.getDisplayWebLabelByObjectId("LBL_TAB_HDR"))
		.setHidden(false)
		.setTabJsp("AccessTeamHdrTab.jsp")
};

TabInfo currentTab = null;
for (int i = 0; i < tabInfos.length; ++i) {
	if (accessTeamMaintenanceForm.getFolderIdx().equals(String.valueOf(i))) {
		currentTab = tabInfos[i];
	}
	if (tabInfos[i].isHidden()) continue;
	%><chtml:button useExtensions="true" uiType="tab" form="accessTeamMaintenanceForm" pageEvent="<%=tabInfos[i].getPageEvent()%>" pageEventSrc="<%=String.valueOf(i)%>" /><%
}

%></ul></div><%
%><div class="titlebar"><span class="headertitletext"><%=currentTab.getTitle()%></span></div>
<div class="maintenance_content">
<logic:notEqual name="accessTeamMaintenanceForm" property="folderIdx" value="0">
<jsp:include page="Access_teamCommon.jsp" flush="true"/>
</logic:notEqual>
<jsp:include page="<%=currentTab.getTabJsp()%>" flush="true"/>
</div>
</html:form>
